1. Field of the Invention
The present invention relates to a non-volatile memory into which writing is performed in units of blocks and, more particularly, relates to a memory management method therefor and a portable terminal device using the non-volatile memory.
2. Description of the Related Art
For portable terminal devices (also referred to simply as “portable terminals”), including portable phone terminals, a flash memory is used as a rewritable, non-volatile semiconductor memory. Among the flash memories, there are NAND and NOR types. A NAND-type flash memory (hereinafter also referred to as a “NAND memory”) has the features that it is suitable for implementation of a large-capacity storage device, the cost per unit capacity is low, but reading and writing in only units of blocks of a fixed size are possible, and random access is slow. On the other hand, a NOR-type flash memory has the features that the reading and writing speed are high, high-speed random access is possible, but it is not suitable for a high degree of integration, and a large electrical current is necessary for writing.
Accordingly, a NAND memory that is advantageous in terms of cost, degree of integration, and power consumption is used for storing a program of a portable terminal. When booting from a NAND memory, a program area is temporarily transferred from a NAND memory to a RAM, such as SDRAM (Synchronous Dynamic Random Access Memory), and the program is executed in the RAM. For this reason, the program main body is resident in the NAND memory.
It is common that defective blocks are already present in a NAND memory before shipment. Furthermore, it is necessary to consider that the NAND memory will deteriorate with use, and a block that was a good block initially will become defective.